<template>
	<div>
		<!-- 我的回答列表 -->
		<div style="margin-top: 5%;">
			<div v-for="(item, index) in quetion_list" :key="index">
				<van-cell is-link @click="getQuestionDetail(item)">
					<view slot="title">
						<van-row gutter="20">
							<van-col span="3">
								<image src="https://czsc.oss-cn-beijing.aliyuncs.com/mini/dg.png"
									style="width: 30px;height: 30px;"></image>
							</van-col>
							<van-col span="20">
								<view class="van-cell-text" style="font-size: 15px;font-family: '苹方';margin-top: 5px;">
									{{ item.questionTitle }}</view>
							</van-col>
						</van-row>
					</view>
				</van-cell>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		data(){
			return{
				myanswer_questionids: [],
				quetion_list: []
			}
		},
		created() {
			uni.request({
				method: 'POST',
				url: 'https://www.gjegm.ltd/czsczq/expertAnswer/getOpenidByUserid',
				data: {
					userid: uni.getStorageSync('userid')
				},
				header: {
					'content-type': 'application/x-www-form-urlencoded',
					'token': uni.getStorageSync('token')
				},
				success: (res) => {
					console.log(res.data.obj)
					this.myanswer_questionids = res.data.obj;
					uni.request({
						method: 'POST',
						url: 'https://www.gjegm.ltd/czsczq/expertQuestion/getQuestionsById',
						data: {
							questionids: this.myanswer_questionids
						},
						header: {
							'content-type': 'application/x-www-form-urlencoded',
							'token': uni.getStorageSync('token')
						},
						success: (res1) => {
							this.quetion_list = res1.data.obj;
							
						}
					});
				}
			});
		},
		methods: {
			getQuestionDetail(val){
				console.log(val)
				uni.navigateTo({
					url: '/pages/question_answer/question_haveanswer?id=' + val.id + '&question=' + val.question + '&question_user=' + val.questionUser + 
					'&question_time=' + val.questionTime + '&question_userid=' + val.questionUserid
				});
			},
		}
	}
</script>

<style>
</style>